package com.student.dao.impl;

import com.student.dao.AdminDao;
import com.student.dao.BaseDao;
import com.student.pojo.Admin;

/**
 * @author lin945
 * @date 2020/4/25 13:05
 */
public class AdminDaoImpl extends BaseDao implements AdminDao {
    @Override
    public boolean existAdmin(Admin admin) {
        String sql="select * from admin where username=?";
        return querForOne(Admin.class,sql,admin.getUsername())!=null;
    }

    @Override
    public Admin querAdminByNameAndPassword(Admin admin) {
        String sql="select * from admin where username=? and password=?";
        return querForOne(Admin.class,sql,admin.getUsername(),admin.getPassword());
    }

    @Override
    public boolean saveAdmin(Admin admin) {

        return false;
    }
}
